<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class RSSFeed extends CI_Controller {
    
   	public function __construct()
    {
        parent::__construct();
        $this->load->model('MPage');
        $this->load->helper('xml'); 
    }
    
	public function index()
	{
	    $data['encoding'] = 'utf-8';
        $data['feed_name'] = 'www.chamroeun.com';
        $data['feed_url'] = 'http://www.chamroeun.com';
        $data['page_description'] = 'Chamroeun Microfinance Limited - hot articles';
        $data['page_language'] = 'en-en';
        $data['creator_email'] = 'bunthorn@chamroeun.com';  
        $data['articles'] = $this->MPage->getLatestArticles(5);
        $this->load->vars($data);
        header("Content-Type: application/rss+xml");
        $this->load->view('site/rssfeed');	   
	}
	
}
